<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.14.
   家居公司在建工地列表($$)*/

!defined('Q_PATH') && exit;

class Build_C_Controller extends InitController{

	public function index(){
		$arrJiajucompany=$this->_oParent->_arrJiajucompany;
		
		Core_Extend::getSeo($this,array(
			'title'=>"{$arrJiajucompany['jiajucompany_fullname']}在建工地",
			'keywords'=>"{$arrJiajucompany['jiajucompany_fullname']}在建工地",
			'description'=>"通过{$GLOBALS['_option_']['site_name']}您可以及时准确的了解{$arrJiajucompany['jiajucompany_fullname']}的最新在建工地，以便于免费预约参观。",
		));

		// 在建工地列表
		$arrWhere=array();
		$arrWhere['jiajubuild_status']=1;
		$arrWhere['jiajucompany_id']=$arrJiajucompany['jiajucompany_id'];

		$nTotal=Model::F_('jiajubuild')->where($arrWhere)->getCounts();
		$oPage=Page::RUN($nTotal,10,Jiaju_Extend::getBuildpageUrl($arrJiajucompany,false));
		$arrBuilds=Model::F_('jiajubuild')
			->setColumns('jiajubuild_id,jiajubuild_thumb,jiajubuild_title,jiajubuild_progress,jiajubuild_realspace,jiajubuild_starttime,jiajubuild_endtime,jiajubuild_realprice,jiajubuild_owner')
			->where($arrWhere)
			->order('jiajubuild_id DESC')
			->limit($oPage->S(),$oPage->N())
			->getAll();

		$this->assign('arrBuilds',$arrBuilds);
		$this->assign('nTotalBuild',$nTotal);
		$this->assign('sPageNavbar',$oPage->P(array('id'=>'pagination','style'=>'li','current'=>'active')));
		$this->display(Jiaju_Extend::getTemplate($arrJiajucompany,'build'));
	}

}
